Skip to content

Instantly share code, notes, and snippets.

View po5i's full-sized avatar
🪴
Keep coding

Carlos V. po5i

🪴
Keep coding
View GitHub Profile
@po5i
po5i / gist:b7c1f7230277bdb4aa5ce68c66b37eed
Created November 11, 2018 17:02 — forked from burnash/gist:d6d35fbabd2566f2b1b9
Find strings with non-latin characters in files
import sys
import os
import codecs
import unicodedata as ud
# from http://stackoverflow.com/questions/3094498/how-can-i-check-if-a-python-unicode-string-contains-non-western-letters
latin_letters = {}
@po5i
po5i / inline-svg-function.scss
Created September 5, 2018 19:47 — forked from JacobDB/inline-svg-function.scss
Inline SVG function [SASS]
// Replace letters
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
@po5i
po5i / targetted-delete.php
Last active April 9, 2018 22:37 — forked from caseysoftware/targetted-delete.php
This is a simple script using the Twilio PHP Helper library to retrieve Calls within a certain date range and the delete their associated recordings if they're particularly short.
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php';
use Twilio\Rest\Client;
// Your Account Sid and Auth Token from twilio.com/console
$sid = "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
$token = "your_auth_token";
$toNumber = "{fill this in with your number}";
@po5i
po5i / delete-recordings.curl
Last active April 9, 2018 22:20 — forked from caseysoftware/gist:1878920
This is a simple script using cURL to delete a single recording.
curl -X DELETE 'https://api.twilio.com/2010-04-01/Accounts/ACxxxx/Recordings/RExxxx.json' \
-u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
@po5i
po5i / delete-recordings.py
Last active April 9, 2018 22:18 — forked from caseysoftware/delete-recordings.py
This is a simple script using the Twilio Python module to retrieve Recordings within a certain date range and then delete them.
from datetime import date
from twilio.rest import Client
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)
recordings = client.recordings.list(date_created_after=date(2012, 1, 1))
for recording in recordings:
@po5i
po5i / delete-recordings.php
Last active April 9, 2018 22:40 — forked from caseysoftware/delete-recordings.php
This is a simple script using the Twilio PHP Helper library to retrieve Recordings within a certain date range and then delete them.
<?php
// Get the PHP helper library from https://twilio.com/docs/libraries/php
require_once '/path/to/vendor/autoload.php';
use Twilio\Rest\Client;
// Your Account Sid and Auth Token from twilio.com/console
$sid = "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
$token = "your_auth_token";
$twilio = new Client($sid, $token);