Skip to content

Instantly share code, notes, and snippets.

View pepicrft's full-sized avatar
🌱
Open-sourcing

Pedro Piñera Buendía pepicrft

🌱
Open-sourcing
View GitHub Profile
@kcubero27
kcubero27 / remove-tweets-and-undo-retweets.js
Created July 13, 2023 17:26
Remove Tweets and ReTweets
const scrollToBottom = () => {
window.scrollTo({ top: document.body.scrollHeight });
};
const sleep = (ms) => {
return new Promise((resolve) => setTimeout(resolve, ms));
};
const obtainTweets = () => {
return document.querySelectorAll("[data-testid='tweet']");
import Foundation
do {
// Note: scalar.utf8 is only available in 10.15
while let byte = try RawMode.getByte() {
let scalar = UnicodeScalar(byte)
switch scalar.isASCII {
case true:
print(Character(UnicodeScalar(byte)), ":", byte)
case false:
@mxcl
mxcl / detweet.swift
Last active December 23, 2023 23:22
Delete all tweets and favorites older than two months ago. Instructions in comment.
#!/usr/bin/swift sh
import Foundation
import PromiseKit // @mxcl ~> 6.5
import Swifter // @mattdonnelly == b27a89
let swifter = Swifter(
consumerKey: "FILL",
consumerSecret: "ME",
oauthToken: "IN",
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html"
@fiznool
fiznool / fix-rn-xcode10.sh
Created October 30, 2018 11:59
Fixes the third party dependency issues introduced by Xcode 10's new build system.
#!/usr/bin/env bash
# Fix the third party mess. Run this after a `npm/yarn` install.
# This has (hopefully) been addressed by https://github.com/facebook/react-native/pull/21458,
# but at the time of writing (30/10/18) has not been merged into an official RN release.
echo "Fixing React Native third party folder..."
rm -rf ~/.rncache
WD=$(pwd)
cd node_modules/react-native
rm -fr third-party
@maxivak
maxivak / __readme.md
Last active January 19, 2024 15:00
Load code in libraries in Rails 5

Load lib files in production (Rails 5)

If you have your code defined in classes in lib/ folder you may have problems to load that code in production.

Autoloading is disabled in the production environment by default because of thread safety.

Change config/application.rb:

    config.autoload_paths << Rails.root.join("lib")
 config.eager_load_paths &lt;&lt; Rails.root.join("lib")
@soffes
soffes / Rakefile
Last active January 16, 2023 16:37
Programmatically build and sign a Developer ID macOS app
TEAM_ID = 'XXXXXXXXXX'
APP_NAME = 'My App'
SCHEME_NAME = APP_NAME
desc 'Create a beta build'
task :build do
# Ensure clean git state
unless system 'git diff-index --quiet HEAD --'
abort 'Failed. You have uncommitted changes.'
end
@micho
micho / gist:855b272d2f408f04729e
Last active October 9, 2015 14:08
Github PRs: Collapse/expand file
// Add a button to Collapse or Expand files in a Github PR
//
// See it in action: http://cl.ly/image/1r3q3d0d3b0p
//
// Install Tampermonkey and add this as a script
// ==UserScript==
// @name Github PRs: Collapse/expand file
// @namespace https://gist.github.com/micho/855b272d2f408f04729e
// @version 0.1
@dfreniche
dfreniche / swift.sh
Created August 28, 2014 06:07
Bash script to launch swift from command line, with all Xcode6-Betas around
#!/bin/bash
# swift.sh: Bash script to launch swift from command line
# it works even with Xcode5 and several Xcode-Beta installed
NEW_XCODE=$(ls -m1 -d /Applications/Xcode6* | tail -r -n 1)/Contents/Developer
echo using $NEW_XCODE
$NEW_XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -sdk $NEW_XCODE
//
// NaturalMotion.swift
//
// Created by Maciej Swic on 2014-06-06.
// Released under the MIT license.
//
import UIKit
extension UIView {
@frowing
frowing / gist:8575251
Last active January 12, 2017 10:58
Remove Caches and Preferences directory on the latest used Simulator app so it gets rebooted to its initial state.
#!/bin/bash
simulatorDirectory="$HOME/Library/Developer/CoreSimulator/Devices"
latestSimulator=$(ls -Ft "$simulatorDirectory"| grep / | head -1)
applicationsDirectory="$simulatorDirectory""/""$latestSimulator/Applications/"
latestApp=$(ls -t "$applicationsDirectory" | head -1)
appDirectory="$applicationsDirectory""/""$latestApp"
libraryDirectory="$appDirectory/Library"
prefDir="$libraryDirectory/Preferences"
cachesDirectory="$libraryDirectory/Caches"