Skip to content

Instantly share code, notes, and snippets.

@xndc
xndc / tunejack.sh
Last active Aug 8, 2020
Instant radio streaming script using the TuneIn API
View tunejack.sh
#!/bin/bash
# tunejack.sh uses the TuneIn public API (at opml.radiotime.com) to search for
# a radio station, print out its details and try to play it somehow.
if [ "$#" -eq 0 ]; then
echo "$0: search for a radio station using the TuneIn API"
echo "Usage: $0 PATTERN"
exit 1
fi
View useEffect
import React, { useState, useEffect } from 'react'
import axios from 'axios'
const User = () => {
const [user, setUser] = useState({})
useEffect(() => {
axios.get('https://jsonplaceholder.typicode.com/users/1').then(it => {
setUser(it.data)
})
@arturmartins
arturmartins / install_bucardo.sh
Created Feb 24, 2016
Install bucardo 5.4.1 in ubuntu 12.04 / 14.04 LTS
View install_bucardo.sh
#!/bin/bash
# Based on the instructions in
# https://bucardo.org/wiki/Bucardo/Installation
# -------- configuration: Variables
BUCARDO_VERSION='5.4.1'
DOWNLOAD_URL="http://bucardo.org/downloads/Bucardo-${BUCARDO_VERSION}.tar.gz"
# -------------------------------
TEMP_FILE="/tmp/${RANDOM}.tar.gz"
View workflow.yml
name: CI
on:
push:
branches: [master]
env:
BUCKET: reactdeploy.getomni.dev
jobs:
@ruancarvalho
ruancarvalho / jquery-add-table-row.js
Created Apr 9, 2016
Função AddTableRow com jQuery
View jquery-add-table-row.js
(function($) {
AddTableRow = function() {
var newRow = $("<tr>");
var cols = "";
cols += '<td>&nbsp;</td>';
cols += '<td>&nbsp;</td>';
cols += '<td>&nbsp;</td>';
cols += '<td>&nbsp;</td>';
View sql-mongo_comparison.md

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@yashodhank
yashodhank / admin
Last active Aug 8, 2020
Plesk Trial License Update Automation
View admin
A00M00-R0MZ05-YMNH13-15YM73-XMQB25
View ECCKeyAgreement.java
// The following code is from http://www.academicpub.org/PaperInfo.aspx?PaperID=14496 .
import java.math.BigInteger;
import java.security.*;
import java.security.spec.*;
import javax.crypto.KeyAgreement;
public class ECCKeyAgreement {
public static void main(String[] args) throws Exception {
KeyPairGenerator kpg;
kpg = KeyPairGenerator.getInstance("EC","SunEC");
@ju2wheels
ju2wheels / Dockerfile
Last active Aug 8, 2020
Docker Dockerfile reference template
View Dockerfile
# Last updated: 08/24/2916
#
# Total instructions available: 18
#
# https://docs.docker.com/engine/reference/builder/
#
# You can use a .dockerignore file in the same context directory as
# your Dockerfile to ignore files in the context before sending them
# to the Docker daemon for building to speed up building.
@stephenhardy
stephenhardy / git-clearHistory
Created Apr 26, 2013
Steps to clear out the history of a git/github repository
View git-clearHistory
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
You can’t perform that action at this time.