Skip to content

Instantly share code, notes, and snippets.

View josealvarez97's full-sized avatar
Playing soccer

José Alvarez C. josealvarez97

Playing soccer
  • San Francisco, California
View GitHub Profile
@diorahman
diorahman / client.html
Created December 26, 2011 03:34
Ajax, call jQuery POST to node.js expressjs
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active April 15, 2024 14:27
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@darktable
darktable / SavWav.cs
Created April 6, 2012 05:01
Unity3D: script to save an AudioClip as a .wav file.
// Copyright (c) 2012 Calvin Rien
// http://the.darktable.com
//
// This software is provided 'as-is', without any express or implied warranty. In
// no event will the authors be held liable for any damages arising from the use
// of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
@anandkumar
anandkumar / jss-script.js
Created April 26, 2014 12:06
Add 100px offset to jQuery smooth scroll Plugin
/* Smooth Back to Top, Get This functionality from: http://wordpress.org/extend/plugins/cudazi-scroll-to-top/ */
jQuery.noConflict();
jQuery(function($) {
// When to show the scroll link
// higher number = scroll link appears further down the page
var upperLimit = 100;
// Our scroll link element
@GuilleUCM
GuilleUCM / ObjectShake.cs
Last active August 7, 2023 18:34
Unity:Animation:Shake object vibrate
using UnityEngine;
using System.Collections;
/// http://www.mikedoesweb.com/2012/camera-shake-in-unity/
public class ObjectShake : MonoBehaviour {
private Vector3 originPosition;
private Quaternion originRotation;
public float shake_decay = 0.002f;
@wrossmck
wrossmck / makeOSXiso.sh
Created November 18, 2015 11:10
Convert Downloaded El Capitan.app to bootable iso
#!/bin/bash
#taken from http://www.insanelymac.com/forum/topic/308533-how-to-create-a-bootable-el-capitan-iso-fo-vmware/
# Mount the installer image
hdiutil attach /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
# Create the ElCapitan Blank ISO Image of 7316mb with a Single Partition - Apple Partition Map
hdiutil create -o /tmp/ElCapitan.cdr -size 7316m -layout SPUD -fs HFS+J
@varyonic
varyonic / Dockerfile
Created June 10, 2016 14:14
Dockerfile with chromedriver
# See https://codeship.com/documentation/docker/browser-testing/
FROM myapp:base
# We need wget to set up the PPA and xvfb to have a virtual screen and unzip to install the Chromedriver
RUN apt-get install -y wget xvfb unzip
# Set up the Chrome PPA
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@matthewjberger
matthewjberger / notes.md
Last active March 11, 2024 10:21
How to make an electron app using Create-React-App and Electron with Electron-Builder.
library(haven)
df <- read_dta("C:/Users/Vinic/Downloads/turnout.dta")
View(df)
df[1,1]
df[1,]
lm2 <- glm(turnout ~ ., data = df, family = binomial)
summary(lm2)