Skip to content

Instantly share code, notes, and snippets.

Avatar
😇
Launched my first mac app –– Presentify

Ram rampatra

😇
Launched my first mac app –– Presentify
View GitHub Profile
@staltz
staltz / introrx.md
Last active Apr 11, 2021
The introduction to Reactive Programming you've been missing
View introrx.md
@ZeroDragon
ZeroDragon / How to clone a git repo to an existing folder (not empty).md
Last active Apr 9, 2021
How to clone a git repo to an existing folder (not empty)
View How to clone a git repo to an existing folder (not empty).md
  1. First get to the existing directory
    $ cd my/folder/

  2. Now start a new git repository
    $ git init

  3. Identify if the current elements on the directory are needed or not and add them to the .gitignore file. When ready...
    $ vim .gitignore

  4. When ready create the first commit on the server

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active Apr 9, 2021
how to delete a git tag locally and remote
View git-tag-delete-local-and-remote.sh
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@tsabat
tsabat / zsh.md
Last active Apr 8, 2021
Getting oh-my-zsh to work in Ubuntu
View zsh.md

Prereq:

apt-get install zsh
apt-get install git-core

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
@chinchang
chinchang / xmlToJson.js
Last active Apr 7, 2021
Function to convert XML to JSON
View xmlToJson.js
/**
* Changes XML to JSON
* Modified version from here: http://davidwalsh.name/convert-xml-json
* @param {string} xml XML DOM tree
*/
function xmlToJson(xml) {
// Create the return object
var obj = {};
if (xml.nodeType == 1) {
@kamermanpr
kamermanpr / install-xcodeCLT-homebrew-git.md
Last active Mar 24, 2021
Install Xcode Command Line Tools, Homebrew, and Git on macOS
View install-xcodeCLT-homebrew-git.md

Install Xcode command line tools, Homebrew, and Git on macOS

Install the following apps on your mac running macOS:

  1. (standalone) Xcode Command Line Tools
  2. Homebrew
  3. Git

Modified from: https://www.moncefbelyamani.com

@itarato
itarato / encryption.java
Created Sep 28, 2014
Java AES CBC encryption example
View encryption.java
package com.company;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.security.MessageDigest;
import java.security.SecureRandom;
public class Main {
@HaNdTriX
HaNdTriX / image_to_data_url.js
Last active Mar 12, 2021
Convert an image to base64URL.
View image_to_data_url.js
/**
* Converts an image to a dataURL
* @param {String} src The src of the image
* @param {Function} callback
* @param {String} outputFormat [outputFormat='image/png']
* @url https://gist.github.com/HaNdTriX/7704632/
* @docs https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement#Methods
* @author HaNdTriX
* @example
*
@tamouse
tamouse / input.md-text
Last active Dec 3, 2020
Adding a class to a table in markdown (using kramdown processor as default in Jekyll).
View input.md-text
# Let's try out a table with kramdown class tag
| A simple | table |
| with multiple | lines|
{: .my-class }
@ManuelPeinado
ManuelPeinado / MainActivity.java
Created Oct 19, 2014
Fading action bar effect using the new Toolbar class from the support library
View MainActivity.java
package com.github.manuelpeinado.toolbartest;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.View;