Skip to content

Instantly share code, notes, and snippets.

View leo424y's full-sized avatar

Fly Chang leo424y

View GitHub Profile
@xdite
xdite / growth-hack.md
Created May 7, 2015 21:15
growth-hack.md
  • What is Growth Hack
  • Customer Life Cycle
  • Landing Page
    • What is Landing Page
    • Different types of Landing Page
    • Copywriting
    • Headline
    • Tagline
    • Resource
  • Unbounce.com
@rippo
rippo / dropdown.change.jsx
Last active August 10, 2018 22:04
ReactJS dropdown list example that gets data from a AJAX call with an on change event
var MyParentChange = React.createClass({
getInitialState: function() {
return {
data: [], value: {}, showOutput: false
}
},
componentDidMount: function() {
$.get(this.props.source, function(result) {
@afilhodaniel
afilhodaniel / gist:09a1df8eafeabe1584c6
Last active November 12, 2020 10:20
Upload photos to Instagram via private API with Ruby
class InstagramPrivateController < ApplicationController
def initialize(username, password, photo, caption)
@username = username
@password = password
@photo = photo
@caption = caption
@cookiepath = Tempfile.new('cookies').path
@user_agent = generate_user_agent()
@samhernandez
samhernandez / mysqlsync
Last active September 8, 2024 15:07
Sync remote mysql database to local over ssh
#!/bin/bash
# This script assumes you have ssh access to a remote server
# Both databases are backed up to sql files in the same directory
# this script is executed from.
# Usage:
# 1. Make sure this file is executable with `chmod +x mysqlsync`
# 2. Set the credentials for the variables at the top
# (Remember, no spaces around the '=' sign)
# 3. Run it from a directory where you'd like the backup files to go:

Git Cheat Sheet

Commands

Getting Started

git init

or

@srikanthjeeva
srikanthjeeva / https GET request with Basic Auth in Ruby
Created January 28, 2015 20:33
https GET request with Basic Auth in Ruby
require 'net/http'
require 'net/https'
require 'uri'
uri = URI('https://example.com/rest/api/2/1')
Net::HTTP.start(uri.host, uri.port,
:use_ssl => uri.scheme == 'https',
:verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|
@abola
abola / JenkinsFullBackup.sh
Last active October 1, 2022 19:44
Jenkins Full Backup Script
#!/bin/sh
###
# Easy Jenkins backup script
#
# Save script and named JenkinsFullBackup.sh
# chmod +x JenkinsFullBackup.sh
#
# Which path of your jenkins install
JENKINS_HOME=/var/lib/jenkins
@xavriley
xavriley / README.md
Last active August 27, 2025 17:54
Original NES Mario Theme for Sonic Pi

Making Chiptune Music using Sonic Pi v2.0

Warning: this might not work on a RaspberryPi yet

I was curious about making retro gaming sounds using Sonic Pi. A couple of months and a lot of Googling later, here's the original Mario Bros theme as it was heard on the NES console.

I'm (just about) old enough to remember rushing home from school to play this game at Philip Boucher's house, sitting cross-legged in front of the TV till my feet got pins and needles. Working out how to recreate it for Sonic Pi was a lot of fun!

Getting the sounds of the NES chip

@greghelton
greghelton / datatables.rb
Last active July 30, 2018 06:42
DataTables.net plus JRuby and Sinatra ... for instructions, see http://opensourcetips.blogspot.com/2014/09/datatablesnet-jruby-sinatra.html
require 'sinatra'
require 'sinatra/reloader' if development?
require 'lib/jt400.jar'
require 'yaml'
require 'json'
require 'logger'
$log = Logger.new('logs/log.txt','weekly')
$log.level = Logger::DEBUG
@wdullaer
wdullaer / install.sh
Last active October 4, 2025 11:31
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"