Skip to content

Instantly share code, notes, and snippets.

@SuperPaintman
SuperPaintman / npm-f3-install.sh
Last active April 21, 2024 23:41
NPM install for low RAM machins. And "npm install ... killed" problem
#!/bin/bash
#
# Author: SuperPaintman <SuperPaintmanDeveloper@gmail.com>
#
###
# Constants
###
RETVAL=0
@jtilly
jtilly / install-gcc-4.9.3.sh
Last active April 11, 2024 07:28
Install GCC 4.9.3
#!/bin/bash
# this script installs GCC 4.9.3
# to use it navigate to your home directory and type:
# sh install-gcc-4.9.3.sh
# download and install gcc 4.9.3
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.gz
tar xzf gcc-4.9.3.tar.gz
cd gcc-4.9.3
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
DIR=/var/app/current
if [ "$WORKER_MODE" = "1" ]
then
if [ -f /var/run/shoryuken.pid ]
then
su -l -c "kill -USR1 `cat /var/run/shoryuken.pid`" root || echo "no process"
su -l -c "rm -f /var/run/shoryuken.pid" root || echo "no file"
fi
@jiaaro
jiaaro / _INSTRUCTIONS.md
Last active January 22, 2024 17:47
Using Swift libraries in Python

Using Swift libraries in Python

So... this is obviously totally, 100%, like for. real. not. supported. by. Apple. …yet?

But still... I thought it was pretty badass. And, seeing how there's already a Swift buildpack for Heroku you could move some slow code into Swift can call it as a library function. But, you know, not in production or anything. That would be silly, right?

Now, having said that, the actual Python/Swift interop may have bugs. I'll leave that as an exercise to the reader.

How to get Python code calling Swift functions:

@maxivak
maxivak / 00.md
Last active May 6, 2024 15:27
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.

ActionMailer

Create your mailer us usual:

@cotsog
cotsog / .travis.yml
Created July 31, 2015 16:09
.travis.yml for gcc-5 compiler support on Travis CI
sudo: required
script:
- sudo unlink /usr/bin/gcc && sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc
- gcc --version
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- gcc-5
@karpathy
karpathy / min-char-rnn.py
Last active May 6, 2024 16:42
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@wy36101299
wy36101299 / climate_crawler.py
Last active November 7, 2018 07:34
台灣中央氣象局觀測資料爬取
# 產生data List , data List為兩年份
def date():
month31=[1,3,5,7,8,10,12]
month30=[4,6,9,11]
year2=['2013','2014']
nday31=range(1,32)
nday30=range(1,31)
nday28=range(1,29)
day10=['01','02','03','04','05','06','07','08','09']
month12=day10+['10','11','12']
@ChuckJHardy
ChuckJHardy / digital_ocean_setup.md
Last active October 27, 2023 17:51
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password