Skip to content

Instantly share code, notes, and snippets.

View jacksonfdam's full-sized avatar
💻
Coding...

Jackson F. de A. Mafra jacksonfdam

💻
Coding...
View GitHub Profile
@jacksonfdam
jacksonfdam / gist:3000275
Created June 26, 2012 23:56
Regular Expressions List
//Regular Expressions List
//Short Tutorial
\ // the escape character - used to find an instance of a metacharacter like a period, brackets, etc.
. // match any character except newline
x // match any instance of x
^x // match any character except x
[x] // match any instance of x in the bracketed range - [abxyz] will match any instance of a, b, x, y, or z
| // an OR operator - [x|y] will match an instance of x or y
// Screen Template
package ${PACKAGE_NAME}
import androidx.compose.runtime.Composable
import androidx.navigation.NavController
@Composable
fun ${NAME}Screen(
${NAME}State: ${NAME}UIState,
@jacksonfdam
jacksonfdam / gist:4760514
Created February 12, 2013 05:44
Ken Street Fighter CSS Sprite ANimation
<div class="stage">
<div class="ken stance"></div>
</div>
<div class="commands">
<h1>Control Ken's moves with ur keyboard</h1>
# phpstorm, webstorm
.idea/
/.vscode
/nbproject
/node_modules
# sublime and other ide
.project
*.sublime-project
*.sublime-workspace
@jacksonfdam
jacksonfdam / gist:5102342
Created March 6, 2013 19:36
Restringir o tipo de arquivos no upload, pelo front-end.
<input type="file" accept="image/jpg,image/jpeg,image/png,image/gif,image/bmp,image/tiff" />
http://stackoverflow.com/questions/651700/how-to-have-jquery-restrict-file-types-on-upload
Ou
$('INPUT[type="file"]').change(function () {
var ext = this.value.match(/\.(.+)$/)[1];
switch (ext) {
case 'jpg':
@jacksonfdam
jacksonfdam / gist:2853386
Created June 1, 2012 16:32
jQuery replace all characters with asterisks
//iVal is your string of characters (with asterisks).
iVal = iVal.substr(i).replace(/[\S]/g, "*");
@jacksonfdam
jacksonfdam / index.html
Created May 16, 2022 09:05
Web RTC - Sound and Microphone Check
<main class="has-background-dark">
<div class="is-family-sans-serif has-text-white has-text-centered">
<h1 class="is-size-1 has-text-centered is-uppercase has-text-weight-bold">Sound check!</h1>
<p class="">See if your microphone and headphones are setup properly</p>
<p> For the Microphone test, a prompt will appear asking for permission to access your select output device </p>
<p>If you are not using headphones, it'll have a loop feedback</p>
<p></p>
<button class="button is-primary is-fullwidth is-large" id="micTest" type="button">Test Microphone</button>
<button class="button is-link is-light is-fullwidth is-medium" id="soundTest" type="button">Test Headphone/Speakers</button>
@jacksonfdam
jacksonfdam / gist:3000392
Created June 27, 2012 00:12
HTML Test Page for CSS Style Guide
<!--
URL: http://www.sitefromscratch.com/content/html-xhtml-css-testing
Great page for testing the style guide for a website.
--->
<!-- Sample Content to Plugin to Template -->
<h1>CSS Basic Elements</h1>
<p>The purpose of this HTML is to help determine what default settings are with CSS and to make sure that all possible HTML Elements are included in this HTML so as to not miss any possible Elements when designing a site.</p>
@jacksonfdam
jacksonfdam / gist:2853345
Created June 1, 2012 16:25
The Best Way to Load jQuery Library (with fallback)
//Load jQuery Library
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/ext/jquery-1.7.2.min.js"><\/script>')</script>
<!-- Grab Google CDN's jQuery UI, with a protocol relative URL; fall back to local if offline -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"></script>
<script>window.jQuery.ui || document.write('<script src="js/ext/jquery-ui.min.js"><\/script>')</script>
@jacksonfdam
jacksonfdam / gist:2853381
Created June 1, 2012 16:31
jQuery Ajax Validation Use the Remote Rule
//VALIDATE USER EMAIL
$(':input[name="uAcc"]').rules("add",
{
  "remote" :
  {
      url: validateEmail.php',
      type: "post",
      data:
      {
          emails: function()