Skip to content

Instantly share code, notes, and snippets.

@10maurycy10
10maurycy10 / uninstall_rippling.sh
Created March 15, 2022 22:03
A script to remove Rippling MDM. take from right from /opt/rippling:
#!/bin/bash
export PS4='+[$(date -u)][${BASH_SOURCE}:${LINENO}]: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'; set -x;
if [ `id -u` -ne 0 ]; then
echo "Rippling uninstall must be run by root"
exit 1
fi
sudo launchctl unload /Library/LaunchDaemons/com.rippling.*
@natterstefan
natterstefan / README.md
Created February 18, 2020 14:47
Jest | Mock useState

Jest - mock useState

When using import React, { useState } from 'react' in your components, this is how you can mock useState with jest.

@JulianNorton
JulianNorton / uninstall-rippling.sh
Created August 13, 2018 22:31
uninstall rippling
#!/bin/bash
if [ `id -u` -ne 0 ]; then
echo "Rippling uninstall must be run by root"
exit 1
fi
sudo launchctl unload /Library/LaunchDaemons/com.rippling.*
sudo rm -rf /Library/LaunchDaemons/com.rippling.*
sudo rm -rf /opt/rippling
@pyjavo
pyjavo / zen_python.md
Last active February 3, 2021 07:28
El zen de Python: Explicado y con ejemplos

El Zen de Python

============ Este post se encuentra publicado en https://pybaq.co/blog/el-zen-de-python-explicado/ ===========

Si alguna vez abren la consola de python y escriben import this verán que les aparecerán las líneas con el famoso Zen de Python:

  1. Beautiful is better than ugly.
  2. Explicit is better than implicit.
@mort3za
mort3za / git-auto-sign-commits.sh
Last active January 30, 2024 10:31
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@meiqimichelle
meiqimichelle / USstates_avg_latLong
Created December 1, 2013 02:08
JSON of US states (full names) and their average lat/long
[
{
"state":"Alaska",
"latitude":61.3850,
"longitude":-152.2683
},
{
"state":"Alabama",
"latitude":32.7990,
"longitude":-86.8073
@kerimdzhanov
kerimdzhanov / random.js
Last active November 12, 2023 15:11
JavaScript: get a random number from a specific range
/**
* Get a random floating point number between `min` and `max`.
*
* @param {number} min - min number
* @param {number} max - max number
* @return {number} a random floating point number
*/
function getRandomFloat(min, max) {
return Math.random() * (max - min) + min;
}
@caniszczyk
caniszczyk / clone-all-twitter-github-repos.sh
Created October 9, 2012 04:25
Clone all repos from a GitHub organization
curl -s https://api.github.com/orgs/twitter/repos?per_page=200 | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@matiasherranz
matiasherranz / date_periods_handler.py
Created May 12, 2012 17:32
Date handling util functions
"""
Some date handling util functions I coded for Python/Django.
"""
import calendar
from datetime import datetime
from decimal import Decimal
from django.utils.datastructures import SortedDict