Skip to content

Instantly share code, notes, and snippets.

View justin-lyon's full-sized avatar

Justin Lyon justin-lyon

  • Daejeon, South Korea
View GitHub Profile
@rxaviers
rxaviers / gist:7360908
Last active July 24, 2024 05:30
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nickrussler
nickrussler / gist:7527851
Created November 18, 2013 13:39
Convert Date String to/from ISO 8601 respecting UTC in Java
public static String toISO8601UTC(Date date) {
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
df.setTimeZone(tz);
return df.format(date);
}
public static Date fromISO8601UTC(String dateStr) {
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'");
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active May 20, 2024 16:27 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@justin-lyon
justin-lyon / ssh-cheatsheet
Last active August 3, 2020 14:17
ssh cheatsheet
# generate rsa key-pair without password (-N) with comment (-C) and name (-f)
ssh-keygen -t rsa -b 4096 -N "" -C "userName localName remoteName" -f keyName
# windows bash
# activate ssh-agent in windows bash
eval $(ssh-agent -s)
# list registered ssh keys - these keys are cached by the agent so you only need to enter pw once
ssh-add -l

NOT UP TO DATE!

Things in this document might not work or be broken nowadays

my laptop:

I'm writing this here because a few things in here are spesific to this model laptop.
Dell XPS 15 9560 (4k) touch screen

Some notes:

Most things after setup are not specific for this laptop
# = run as root

def multiply(*numbers):
total = 1
for number in numbers:
total *= number
return total
print("start")
print(multiply(1, 2, 3))
print("finish")
@gdoenlen
gdoenlen / AccountSelector.cls
Last active October 19, 2023 11:42
Simple dependency injection within SFDC
/**
* Selector for the `Account` entity
*/
public class AccountSelector {
public static final AccountSelector INSTANCE = new AccountSelector();
/**
* Finds all accounts that are child accounts of
* the given opportunity's account.
@surajp
surajp / webpack.config.js
Created November 6, 2019 21:20
basic webpack config
const path = require('path');
module.exports = {
mode: "production",
entry: "./src/index",
output: {
// options related to how webpack emits results
path: path.resolve(__dirname, "dist"), // string
// the target directory for all output files
// must be an absolute path (use the Node.js path module)
@gbutt
gbutt / BatchGrantPermissionSet.cls
Created February 8, 2020 15:57
Grant Permission Set or Permission Set Group to Users in Batch Apex
/**
* Assigns a permission set or permission set group to all user with the specified profile.
* Additional filter criteria can be passed in if the users needs filtered further.
* Example: Only assign permission set to community users on the Salesforce account
* String filter = 'Contact.Account.Name = \'Salesforce\'';
* BatchGrantPermissionSet('Community User Profile', 'Salesforce_Account_Privs', filter);
*/
public class BatchGrantPermissionSet implements Database.Batchable<sObject> {
String query {get; set;}
@surajp
surajp / CSVColIterator.cls.java
Created April 10, 2020 00:12
CSV Column Iterator
public class CSVColIterator implements Iterator<String> {
private String colDelimiter=',';
private String textQualifier='"';
private String row='';
private Integer currentIndex=0;
public CSVColIterator(String row){
this.row = row;
}