This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stage 1: Build a React Docker Image | |
FROM node as build | |
WORKDIR /app | |
COPY package*.json /app/ | |
RUN npm install | |
COPY . /app | |
RUN npm run build | |
# Stage 2, use the compiled app, ready for production with Nginx | |
FROM nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def flatten(items): | |
new_items = [] | |
for item in items: | |
if type(item) == int: | |
new_items.append(item) | |
else: | |
new_items += flatten(item) | |
return new_items | |
print(flatten([[1,2,[3]],4])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that "dhilipsiva.id" is my Blockstack ID. https://onename.com/dhilipsiva |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// INSTRUCTIONS: | |
// 1. Update "USERNAME", "PASSWORD" and "COMPANY" | |
// 2. In terminal, run `pjantomjs clockin.js` | |
// 3. Have a coffee and start coding away :) | |
// You can also run this as a CRON script everyday! | |
var USERNAME="USERNAME", | |
PASSWORD="PASSWORD", | |
COMPANY="COMPANY", | |
sys = require("system"), | |
page = require("webpage").create(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# vim: fenc=utf-8 | |
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 | |
# | |
# | |
""" | |
File name: spreadsheet.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is Google Sheet custom scripts to get total stats. | |
*/ | |
function BFCOUNT(range) { | |
var ss = SpreadsheetApp.getActive(); | |
var numRows = range.length; | |
var items = {}; | |
for (var key in range) { | |
if (range.hasOwnProperty(key)) { | |
item = range[key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# create_instances.sh | |
# Copyright (C) 2016 dhilipsiva <[email protected]> | |
# | |
# Distributed under terms of the MIT license. | |
# | |
INSTANCES=3 | |
PREFIX_APP="deisdemo-" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chr, codes, i, len, str; | |
str = "text"; | |
codes = []; | |
for (i = 0, len = str.length; i < len; i++) { | |
chr = str[i]; | |
codes.push(chr.charCodeAt(0)); | |
} | |
console.log(codes); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
Badoo spam and like users. | |
Restrictions due to messages limit per day and captchas still cannot be bypassed. :P | |
### | |
getPage = (url) -> | |
$.get url | |
.done (response, success, xhr) -> | |
results = $ response | |
for result in results.find ".user-card" | |
d1 = $ result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getPage = (url) -> | |
$.get url | |
.done (response, success, xhr) -> | |
results = $ JSON.parse(response).html | |
for result in results.find ".card--gridFlex" | |
d1 = $ result | |
profile_id = d1.find(".jsCard").attr "id" | |
continue if !profile_id | |
profile_id = profile_id.replace "profile_", "" | |
data = |
NewerOlder